
/* this file is to do analysis for Facs-childcare*/
use c:\lsac\leigh\leigh,clear

drop k1h*
ren afinc incfath
ren aminc incmoth
ren ap2 dbothprnt
g finc=incmoth+incfath if dbothprnt==1&incmoth>=0&incmoth<.&incfath>=0&incfath<.
replace finc=incmoth if dbothprnt==0&incmoth>=0&incmoth<.&agem>0&agem<.
replace finc=incfath if dbothprnt==0&incfath>=0&incfath<.&agef>0&agef<.
g dremote=1
replace dremote=0 if aremote==0|aremote==1

g lfinc=ln(finc)
drop if lfinc==.

drop if ind_soc==.|acoi==.|ind_phy==.|ind_lrn==.
drop if aborg==.
drop if wtbirth<=0
drop if highed_f==.&agef~=-9
/*Find out why the following bservation has missing father's low edu and year 12 edu*/
replace lowed_f=0 if lowed_f==. & certi_f==1
replace year12_f=0 if year12_f==. & certi_f==1

replace highed_f=0 if dbothprnt==0&agem>0&agem<.
replace certi_f=0 if dbothprnt==0&agem>0&agem<.
replace diploma_f=0 if dbothprnt==0&agem>0&agem<.
replace year12_f=0 if dbothprnt==0&agem>0&agem<.
replace lowed_f=0 if dbothprnt==0&agem>0&agem<.

replace highed_m=0 if dbothprnt==0&agef>0&agef<.
replace certi_m=0 if dbothprnt==0&agef>0&agef<.
replace diploma_m=0 if dbothprnt==0&agef>0&agef<.
replace year12_m=0 if dbothprnt==0&agef>0&agef<.
replace lowed_m=0 if dbothprnt==0&agef>0&agef<.
g wtbirth2 = wtbirth^2
g dpoi=0 if apoi==0
replace dpoi=1 if apoi>0
g dnoi=0 if anoi==0
replace dnoi=1 if anoi>0
replace agem=0 if agm==-9
replace agef=0 if agef==-9
g agem2=agem^2
 log using leigh.log,replace

count
reg acoi aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table3.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 3 OLS estimates for Overall index") ct("Model 5") rdec(3)
reg acoi aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table9.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 9 OLS estimates for Overall index") ct("Model 5") rdec(3)
reg appvt aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table_ppvt.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 3 OLS estimates for Overall index") ct("Model 5") rdec(3)
reg awai aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table_wai.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 3 OLS estimates for Overall index") ct("Model 5") rdec(3)

reg appvt aborg age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote if sex==1
outreg using table_ppvt_male.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 3 OLS estimates for Overall index") ct("Model 5") rdec(3)
reg awai aborg age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote if sex==1
outreg using table_wai_male.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 3 OLS estimates for Overall index") ct("Model 5") rdec(3)
reg appvt aborg age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote if sex==0
outreg using table_ppvt_female.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 3 OLS estimates for Overall index") ct("Model 5") rdec(3)
reg awai aborg age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote if sex==0
outreg using table_wai_female.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 3 OLS estimates for Overall index") ct("Model 5") rdec(3)



reg appvt aborg sex age 
outreg using table_ppvt.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)
reg awai aborg sex age 
outreg using table_wai.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)

reg appvt aborg  age if sex==1
outreg using table_ppvt_male.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)
reg awai aborg age if sex==1
outreg using table_wai_male.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)

reg appvt aborg age if sex==0
outreg using table_ppvt_female.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)
reg awai aborg age if sex==0
outreg using table_wai_female.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)



reg acoi aborg sex age 
outreg using table3.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)
reg acoi sex age agem agem2 if agem>0
outreg using table9.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)

reg appvt aborg age  sex lfinc
outreg using table_ppvt.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)
reg awai aborg sex age  lfinc
outreg using table_wai.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)

reg appvt aborg age  lfinc if sex==1
outreg using table_ppvt_male.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)
reg awai aborg age  lfinc if sex==1
outreg using table_wai_male.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)

reg appvt aborg age  lfinc if sex==0
outreg using table_ppvt_female.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)
reg awai aborg  age  lfinc if sex==0
outreg using table_wai_female.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)



reg acoi aborg sex age  lfinc
outreg using table3.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)

reg acoi sex age agem agem2 lfinc  if agem>0
outreg using table9.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)

reg appvt aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table_ppvt.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)
reg awai aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table_wai.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)

reg appvt aborg  age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote if sex==1
outreg using table_ppvt_male.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)
reg awai aborg age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote if sex==1
outreg using table_wai_male.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)

reg appvt aborg  age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote if sex==0
outreg using table_ppvt_female.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)
reg awai aborg age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote if sex==0
outreg using table_wai_female.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)


reg acoi aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table3.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)
reg acoi aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table9.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)

reg appvt aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table_ppvt.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)
reg awai aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table_wai.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)

reg appvt aborg age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote if sex==1
outreg using table_ppvt_male.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)
reg awai aborg age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote if sex==1
outreg using table_wai_male.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)

reg appvt aborg age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote if sex==0
outreg using table_ppvt_female.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)
reg awai aborg age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote if sex==0
outreg using table_wai_female.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)



reg acoi aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table3.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)
reg acoi aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table9.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)

reg appvt aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0
outreg using table_ppvt.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)
reg awai aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0
outreg using table_wai.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)

reg appvt aborg age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0 &sex==1
outreg using table_ppvt_male.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)
reg awai aborg age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0 &sex==1
outreg using table_wai_male.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)

reg appvt aborg age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0 &sex==0
outreg using table_ppvt_female.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)
reg awai aborg age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0 &sex==0
outreg using table_wai_female.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)


reg appvt sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0&aborg==0
outreg using table_ppvt.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote & no-indigenous") rdec(3)
reg awai sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0&aborg==0
outreg using table_wai.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote & no-indigenous") rdec(3)

reg appvt age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0 &sex==1&aborg==0
outreg using table_ppvt_male.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote & no-indigenous") rdec(3)
reg awai  age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0 &sex==1&aborg==0
outreg using table_wai_male.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote & no-indigenous") rdec(3)

reg appvt age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0 &sex==0&aborg==0
outreg using table_ppvt_female.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote & no-indigenous") rdec(3)
reg awai age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0 &sex==0&aborg==0
outreg using table_wai_female.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote & no-indigenous") rdec(3)



reg acoi aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0
outreg using table3.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)
reg acoi aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 if dremote==0 &agem>0
outreg using table9.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)


reg ind_lrn aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table4.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 4 OLS estimates for leraning index") ct("Model 5") rdec(3)

reg ind_lrn aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table10.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 10 OLS estimates for leraning index") ct("Model 5") rdec(3)

reg ind_lrn aborg sex age 
outreg using table4.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)

reg ind_lrn sex age agem agem2 if agem>0
outreg using table10.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)

reg ind_lrn aborg sex age lfinc
outreg using table4.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)
reg ind_lrn aborg sex age agem agem2 lfinc if agem>0
outreg using table10.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)

reg ind_lrn aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table4.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)

reg ind_lrn aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table10.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)

reg ind_lrn aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table4.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)
reg ind_lrn aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table10.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)

reg ind_lrn aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0
outreg using table4.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)
reg ind_lrn aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 if dremote==0& agem>0
outreg using table10.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)

reg ind_soc aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table5.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 5 OLS estimates for Social index") ct("Model 5") rdec(3)
reg ind_soc aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table11.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 11 OLS estimates for Social index") ct("Model 5") rdec(3)

reg ind_soc aborg sex age 
outreg using table5.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)
reg ind_soc sex age agem agem2 if agem>0
outreg using table11.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)

reg ind_soc aborg sex age lfinc
outreg using table5.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)
reg ind_soc sex age agem agem2 lfinc if agem>0
outreg using table11.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)

reg ind_soc aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table5.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)
reg ind_soc aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table11.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)

reg ind_soc aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table5.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)
reg ind_soc aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table11.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)

reg ind_soc aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0
outreg using table5.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)
reg ind_soc aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 if dremote==0& agem>0
outreg using table11.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)

reg ind_phy  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem 

*dprobit dnoi  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem 


dprobit dnoi  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table6.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 6 Probit estimates of marginal effects on probabilities of being in problematic area (overall)") ct("Model 5") rdec(3)
dprobit dnoi  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table12.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 12 Probit estimates of marginal effects on probabilities of being in problematic area (overall)") ct("Model 5") rdec(3)

dprobit dnoi aborg sex age 
outreg using table6.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)
dprobit dnoi sex age agem agem2 if agem>0
outreg using table12.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)


dprobit dnoi aborg sex age lfinc
outreg using table6.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)
dprobit dnoi sex age agem agem2 lfinc if agem>0
outreg using table12.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)

dprobit dnoi aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table6.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)
dprobit dnoi aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table12.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)

dprobit dnoi aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table6.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)
dprobit dnoi aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table12.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)

dprobit dnoi aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0
outreg using table6.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)
dprobit dnoi aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 if dremote==0&agem>0
outreg using table12.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)

dprobit ansco  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table7.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 7 Probit estimates of marginal effects on probabilities of being in problematic area (social)") ct("Model 5") rdec(3)
dprobit ansco  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table13.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 13 Probit estimates of marginal effects on probabilities of being in problematic area (social)") ct("Model 5") rdec(3)

dprobit ansco aborg sex age 
outreg using table7.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)
dprobit ansco sex age agem agem2 if agem>0
outreg using table13.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)

dprobit ansco aborg sex age lfinc
outreg using table7.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)
dprobit ansco sex age agem agem2 lfinc if agem>0
outreg using table13.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)

dprobit ansco aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table7.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)
dprobit ansco aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table13.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)

dprobit ansco aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table7.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)
dprobit ansco aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table13.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)

dprobit ansco aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0
outreg using table7.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)
dprobit ansco aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 if dremote==0& agem>0
outreg using table13.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)

dprobit anlco  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table8.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 8 Probit estimates of marginal effects on probabilities of being in problematic area (learning)") ct("Model 5") rdec(3)
dprobit anlco  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table14.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table 14 Probit estimates of marginal effects on probabilities of being in problematic area (learning)") ct("Model 5") rdec(3)

dprobit anlco aborg sex age 
outreg using table8.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)
dprobit anlco sex age agem agem2 if agem>0
outreg using table14.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)

dprobit anlco aborg sex age lfinc
outreg using table8.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)
dprobit anlco sex age agem agem2 lfinc if agem>0
outreg using table14.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 2") rdec(3)

dprobit anlco aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table8.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)
dprobit anlco aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table14.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)

dprobit anlco aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem dremote
outreg using table8.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)
dprobit anlco aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 dremote if agem>0
outreg using table14.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 4") rdec(3)

dprobit anlco aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem if dremote==0
outreg using table8.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)
dprobit anlco aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem agem2 if dremote==0& agem>0
outreg using table14.doc, coefastr nocons bracket 3aster append bdec(3) se  ct("Model 5, non-remote") rdec(3)


/*
dprobit anpco  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem 
dprobit dpoi  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem 
dprobit apsco  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem 
dprobit aplco  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem 
dprobit appco  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem 



mlogit apoi  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem, baseoutcome(0)
mlogit anoi  aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agem, baseoutcome(0)
*/





sum appvt awai acoi ind_phy ind_soc ind_lrn aplco apsco appco anlco ansco anpco anoi apoi  aborg sex age lang_eng wtbirth  dsib dysib finc dbothprnt dremote
sum agem highed_m certi_m diploma_m lowed_m  if e(sample) & agem>0
sum agef highed_f certi_f diploma_f lowed_f if e(sample) & agef>0
tab apoi anoi

sum appvt awai acoi ind_phy ind_soc ind_lrn aplco apsco appco anlco ansco anpco anoi apoi  aborg sex age lang_eng wtbirth  dsib dysib finc dbothprnt dremote if aborg==1
sum agem highed_m certi_m diploma_m lowed_m  if aborg==1 & agem>0
sum agef highed_f certi_f diploma_f lowed_f if aborg==1 & agef>0



log close


gen agemb=agem-age
 gen agemb2=agemb^2

reg acoi aborg sex age lang_eng wtbirth highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agemb agemb2 dremote if agemb>0
outreg using table_agemb.doc, coefastr nocons bracket 3aster replace bdec(3) se ti("Table X OLS estimates for Overall index") ct("Model 5") rdec(3)

reg acoi sex age agemb agemb2 if agemb>0
outreg using table_agemb.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 1") rdec(3)

reg acoi aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt agemb agemb2 dremote if agemb>0
outreg using table_agemb.doc, coefastr nocons bracket 3aster append bdec(3) se ct("Model 3") rdec(3)

replace agemb=. if agemb<15
tab agemb, gen(dagemb)
replace dagemb5=1 if dagemb1==1|dagemb2==1|dagemb3==1|dagemb4==1
drop dagemb1-dagemb4
xi: reg acoi aborg sex age lang_eng highed_m certi_m diploma_m lowed_m highed_f certi_f diploma_f lowed_f dsib dysib lfinc dbothprnt dagemb6-dagemb37  dremote if agemb>0
